let tempfunc = cc.CollisionManager.prototype._doCollide;

cc.CollisionManager.prototype._doCollide = function (collosionType, contact) {
    let contactFunc;
    switch (
        collosionType //根据碰撞类型执行对应的方法
    ) {
        case 1:
            contactFunc = "onCollisionEnter";
            break;
        case 2:
            contactFunc = "onCollisionStay";
            break;
        case 3:
            contactFunc = "onCollisionExit";
            break;
    }

    let collider1 = contact.collider1; //获取碰撞器
    let collider2 = contact.collider2;

    if (collider1.node.group == "monster") {
        //如果碰撞器是怪物
        g_Monster[contactFunc](collider2, collider1);
    }

    if (collider2.node.group == "monster") {
        g_Monster[contactFunc](collider1, collider2);
    }

    tempfunc(collosionType, contact); //执行原方法
};
